﻿using System.Web;
using System.Web.Optimization;

namespace TheCup
{
    public class BundleConfig
    {
        // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
        public static void RegisterBundles(BundleCollection bundles)
        {
            // Styles //
            bundles.Add(new StyleBundle("~/Content/bootstrap", "//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css").Include(
                "~/Content/bootstrap.min.css"));

            bundles.Add(new StyleBundle("~/Content/css").Include(
                "~/Content/bootstrap-datetimepicker.css",
                "~/Content/jquery.cssemoticons.css",
                "~/Content/alertify.core.css",
                "~/Content/alertify.bootstrap.css",
                "~/Content/styles.css"));

            // Scripts //
            bundles.Add(new ScriptBundle("~/bundles/jquery", "//code.jquery.com/jquery-1.11.3.min.js").Include("~/Scripts/jquery-1.11.3.js"));
            bundles.Add(new ScriptBundle("~/bundles/jquery-migrate", "//code.jquery.com/jquery-migrate-1.2.1.min.js").Include("~/Scripts/jquery-migrate-1.2.1.js"));
            bundles.Add(new ScriptBundle("~/bundles/moment", "//cdnjs.cloudflare.com/ajax/libs/moment.js/2.7.0/moment.min.js").Include("~/Scripts/moment-with-langs.js"));
            bundles.Add(new ScriptBundle("~/bundles/moment-da", "//cdnjs.cloudflare.com/ajax/libs/moment.js/2.7.0/lang/da.min.js"));
            bundles.Add(new ScriptBundle("~/bundles/bootstrap", "//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js").Include("~/Scripts/bootstrap.js"));
            bundles.Add(new ScriptBundle("~/bundles/chart", "//cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.1-beta.2/Chart.min.js").Include("~/Scripts/Chart.js"));

            bundles.Add(new ScriptBundle("~/bundles/misc").Include(
                "~/Scripts/bootstrap-datetimepicker.js",
                "~/Scripts/jquery.cssemoticons.js",
                "~/Scripts/alertify.js",
                "~/Scripts/_thecup.js"));

            bundles.Add(new ScriptBundle("~/bundles/globalize").Include(
                "~/Scripts/globalize/globalize.js",
                "~/Scripts/globalize/cultures/globalize.culture.da.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryval", "//ajax.aspnetcdn.com/ajax/jquery.validate/1.13.0/jquery.validate.min.js").Include(
                "~/Scripts/jquery.validate.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryval-unobtrusive").Include(
                "~/Scripts/jquery.validate.unobtrusive.js"
                ));
                        
            // Set EnableOptimizations to false for debugging. For more information,
            // visit http://go.microsoft.com/fwlink/?LinkId=301862
            if (!System.Web.HttpContext.Current.IsDebuggingEnabled)
            {
                BundleTable.EnableOptimizations = true;
                BundleTable.Bundles.UseCdn = true;
            }
        }
    }
}
